package com.masq.agencija.service;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import com.masq.agencija.interfaces.Agent;
import com.masq.agencija.service.Agenti;

public class AgentiBean implements Agenti {
	private Map<String, Agent> agenti = new HashMap<String, Agent>();

	public Collection<Agent> retrieve() {
		return agenti.values();
	}

	public Agent save(Agent agent) {
		return agenti.put(agent.getIme(), agent);
	}

	public Agent retrieveSingleAgent(String ime) {
		return agenti.get(ime);
	}
}